#!/bin/bash

set x

# 生成 Protobuf 类
~/software/protobuf-3.21.12/src/protoc --cpp_out=. include/server/protobuf/PCHAT.proto

# 复制生成的 Protobuf 类文件到客户端和服务器的 protobuf 目录
cp include/server/protobuf/PCHAT.pb.cc src/client/protobuf/
mv include/server/protobuf/PCHAT.pb.cc src/server/protobuf/

rm -rf `pwd`/build/* 
cd `pwd`/build && cmake .. && make -j

